import Vue from 'vue'

// 提交以后禁用按钮一段时间，防止重复提交
Vue.directive('noMoreClick', {
	inserted(el, binding) {
		el.addEventListener('click', e => {
			el.classList.add('is-disabled')
			el.style.cssText = ';cursor:pointer;'
			el.disabled = true
			setTimeout(() => {
				el.disabled = false
				el.classList.remove('is-disabled')
			}, 1500)
		})
	}
})